package cn.com.nes.site.controller;

import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class DubboDemoController {

    @DubboReference
    private DemoService demoService;

    @GetMapping("/sayHello")
    public String sayHello() {
        try {
            return demoService.sayHello("dubbo");
        } catch (Exception e) {
            System.out.println(e + "");
            return "hello agent";
        }
    }
}
